﻿using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace TestProject1
{
    class DataSet_XML
    {

        public void UpisiUXML(string sqlupit, string putanja)
        {

            string connstring = @"Data Source=.\bubisql;Initial Catalog=Pacorini;Integrated Security=True";
            System.Data.SqlClient.SqlConnection con = new SqlConnection(connstring);
            System.Data.SqlClient.SqlDataAdapter adapter = new SqlDataAdapter(sqlupit, connstring);
            var dset = new System.Data.DataSet();
            adapter.Fill(dset);

            dset.WriteXml(putanja);

        }
        
        public System.Data.DataSet ProcitajXML(string putanja)
        {
            //string myXMLfile = "C:\\MySchema.xml";
            var  dset = new System.Data.DataSet();

            dset.ReadXml(putanja);
            //dataGrid1.DataSource = dset;
            return dset;
        }


    }
}
